﻿<UserControl x:Class="Indigo.Quibbler.Controls.ThumbnailViewer"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Height="300" Width="Auto">
    <UserControl.Resources>
        <Style TargetType="{x:Type ListBox}">
            <!-- Set the ItemTemplate of the ListBox to a DataTemplate which
           explains how to display an object of type BitmapImage. -->
            <Setter Property="ItemTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <Image Source="{Binding ImageSource}" Stretch="Fill" Width="160" Height="120" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5" MouseDown="_WindowThumbnailClick"/>
                    </DataTemplate>
                </Setter.Value>
            </Setter>

            <Setter Property="ItemsPanel">
                <Setter.Value>
                    <ItemsPanelTemplate>                        
                        <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                    </ItemsPanelTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <Border>
        <Border.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="White"/>
                <GradientStop Color="#FFBDBEC0" Offset="1"/>
                <GradientStop Color="White" Offset="0.678"/>
            </LinearGradientBrush>
        </Border.Background>
        <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Hidden" Margin="10,10,10,10">
            <ListBox x:Name="listBox" ItemsSource="{Binding}" ScrollViewer.HorizontalScrollBarVisibility="Auto" Background="Black" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
        </ScrollViewer>
    </Border>
</UserControl>
